{% extends 'TopxiaWebBundle:My:layout.html.twig' %}

{% block title %}{{'我的课程'|trans}} - {{ parent() }}{% endblock %}

{% set side_nav = 'my-notes' %}
{% set script_controller = 'my/notebooks' %}

{% block main %}

<div class="panel panel-default panel-col">
  <div class="panel-heading">{{'我的笔记'|trans}}</div>
  <div class="panel-body">
    <ul class="media-list notebook-list" id="notebook-list">
      {% for member in courseMembers %}
        {% set course = courses[member.courseId] %}
              <div class="media">
                <img class="pull-left media-object" src="{{ filepath(course.largePicture, 'course.png') }}">
                <div class="media-body">
                  <h4 class="media-heading">{{course.title}}</h4>
                  <div class="notebook-metas">
                    <span class="notebook-number">{{'共'|trans}} {{ member.noteNum }} {{'篇笔记'|trans}}</span>
                  </div>
                  <div class="notebook-metas">
                    {% if member.noteLastUpdateTime > 0 %}
                      <span class="notebook-time">{{'最后更新'|trans}} {{ member.noteLastUpdateTime | smart_time }}</span>
                    {% endif %}
                    <a class="pull-right notebook-go" href="{{ path('my_notebook_show', {courseId: course.id }) }}">{{'查看笔记'|trans}}</a>
                  </div>
                </div>
              </div>
      {% else %}
        <li class="empty">{{'你还没有写过笔记'|trans}}</li>
      {% endfor %}
    </ul>
    {{ web_macro.paginator(paginator) }}
  </div>
</div>
{% endblock %}